package com.panasonic.web.mapper;


import com.panasonic.web.domain.cms.CmsPermission;
import com.panasonic.web.domain.cms.CmsUser;
import com.panasonic.web.vo.ForgetPasswordVo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;


/**
 * 用户Mapper接口
 *
 * @author lwf
 * @date 2021-11-13
 */
public interface CmsUserMapper {
    /**
     * 查询用户
     *
     * @param id 用户ID
     * @return 用户
     */
    public CmsUser selectCmsUserById(Long id);

    /**
     * 查询用户列表
     *
     * @param cmsUser 用户
     * @return 用户集合
     */
    public List<CmsUser> selectCmsUserList(CmsUser cmsUser);

    /**
     * 新增用户
     *
     * @param cmsUser 用户
     * @return 结果
     */
    public int insertCmsUser(CmsUser cmsUser);

    /**
     * 修改用户
     *
     * @param cmsUser 用户
     * @return 结果
     */
    public int updateCmsUser(CmsUser cmsUser);

    /**
     * 删除用户
     *
     * @param id 用户ID
     * @return 结果
     */
    public int deleteCmsUserById(Long id);

    /**
     * 批量删除用户
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteCmsUserByIds(Long[] ids);

    /**
     * 批量删除全新啊
     *
     * @return 结果
     */
    public int deleteCmsPermissionByUserIds(Long[] ids);

    /**
     * 批量新增全新啊
     *
     * @param cmsPermissionList 全新啊列表
     * @return 结果
     */
    public int batchCmsPermission(List<CmsPermission> cmsPermissionList);


    /**
     * 通过用户ID删除全新啊信息
     *
     * @return 结果
     */
    public int deleteCmsPermissionByUserId(Long id);

    CmsUser selectCmsUserByUsername(@Param("username") String username, @Param("type") String type);

    CmsUser selectCmsUserByName(@Param("username") String username);

    int selectCmsUserByUsernameNotEqId(@Param("id") Long id, @Param("username") String username, @Param("type") String type);

    int selectCmsUserByUsernameNotEqIdGtType(@Param("id") Long id, @Param("username") String username);

    int changeStatus(@Param("ids") Long[] ids, @Param("status") String status, @Param("updateBy") String updateBy, @Param("updateTime") Date updateTime);

    int updateLoginTime(@Param("id") long id, @Param("loginDate") Date loginDate);

    Integer selectManagerCount();

    Integer selectRepairCount();

    CmsUser selectCmsUserByUsernameAndEmail(ForgetPasswordVo forgetPasswordVo);

    List<CmsUser> selectCmsUserByIds(long[] ids);

    void updateBatchPanId();
}
